package cate.game.pvp.minecraft;

import cate.game.db.facade.KvLoader;
import cate.game.db.mongo.kv.KvMongo;
import cate.game.framework.ModuleMan;
import cate.game.pvp.minecraft.data.MinecraftKV;
import lombok.Getter;

@Getter
public class MinecraftDataManager extends ModuleMan {

    private MinecraftKV kv;

    @Override
    public void initDependent() {
        this.kv = new KvLoader<>(game, MinecraftKV.class, KvMongo.KEY_MINECRAFT_GAME).getBySrvId();
    }

    @Override
    public void shutdown() {
        super.shutdown();
        game.db.kv.save(this.kv);
    }
}
